package com.example.cloud.alibaba.seata.common.feign;

import com.example.cloud.alibaba.seata.common.dto.CommodityDTO;
import com.example.cloud.alibaba.seata.common.feign.fallback.RemoteStorageServiceFallback;
import com.example.cloud.alibaba.seata.common.utils.SimpleMessage;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;


/**
 * @Author: lidong
 * @Description  库存服务
 * @Date Created in 2019/9/5 16:22
 */
@FeignClient(value = "openFegin-storage-example", contextId = "storageServiceClient", fallbackFactory = RemoteStorageServiceFallback.class)
public interface IStorageService {

    /**
     * 扣减库存
     */
    @PostMapping("/storage/dec_storage")
    SimpleMessage decreaseStorage(@RequestBody CommodityDTO commodityDTO);
}
